<extend name="Layout/ins_page" />
<block name="content">
	<form method="post" name="form_adv_search" id="form_adv_search">
		<div class="adv_search panel panel-default"  id="adv_search">
			<div class="panel-heading">
				<div class="row">
					<h4 class="col-xs-6">库存查询</h4>
					<div class="col-xs-6 text-right">
						<a  class="btn btn-sm btn-info" onclick="submit_adv_search();">搜索</a>
						<a  class="btn btn-sm btn-info" href="{:U('product')}">重置</a>
					</div>
				</div>
			</div>
			<div class="panel-body">
				<div class="form-group col-sm-6">
					<label class="col-sm-4 control-label" for="like_product">产品名称：</label>
					<div class="col-sm-8">
						<input class="form-control" id="product" type="text" name="li_product" value="{$product}"/>
					</div>
				</div>
				<div class="form-group col-sm-6" >
					<label class="col-sm-4 control-label" for="like_product_bh">产品编号：</label>
					<div class="col-sm-8">
						<input class="form-control" id="product_bh" type="text" name="li_product_bh" value="{$product_bh}"/>
					</div>
				</div>
				<div class="form-group col-sm-6" >
					<label class="col-sm-4 control-label" for="eq_product_type_id">库存类别：</label>
					<div class="col-sm-8">
						<select class="form-control" name="eq_product_type_id">
							<option value="">选择库存类别</option>
							<notempty  name="product_type">
								<foreach name="product_type" item="vo">
									<option value="{$vo['id']}" <if condition="$product_type_id eq $vo['id']">selected="selected"</if>  >{$vo['type_name']}</option>
								</foreach>						
							</notempty >
						</select>
					</div>
				</div>
			</div>
		</div>
	</form>
	<div class="space-8"></div>
	<div class="ul_table ul_table_responsive">
		<ul>
			<li class="thead">
				<span class="col-10 ">产品名称</span>
				<span class="col-8 ">产品类别</span>
				<span class="col-10 ">产品编号</span>
				<span class="col-10 ">入库数</span>
				<span class="col-10 ">出库数</span>
				<span class="col-10 ">库存总数</span>
				<span class="col-12">操作时间</span>
				<span class="col-12">操作</span>
				<!--<div class="pull-right">-->
					<!--<span class="col-12">操作</span>-->
				<!--</div>-->
			</li>
			<empty name="list">
				<li class="no-data">
					没找到数据
				</li>
				<else/>
				<foreach name="list" item="vo">
					<li class="tbody">
						<span class="col-10">{$vo.product}</span>
						<span class="col-8">{$vo.product_type_name}</span>
						<span class="col-10">{$vo.product_bh}</span>
						<span class="col-10"><a href="{:U('index',array('product_id'=>$vo['id'],'type'=>1))}">{$vo.in_num}</a></span>
						<span class="col-10"><a href="{:U('index',array('product_id'=>$vo['id'],'type'=>2))}">{$vo.out_num}</a></span>
						<span class="col-10">{$vo.num}</span>
						<span class="col-12">{$vo.create_at|substr=0,10}</span>
						<span class="col-12 col-sm-end">
							<a href="{:U('editProduct','id='.$vo['id'])}" class="storage_edit">编辑</a>
							<a onclick="delProduct({$vo.id});">删除</a>
						</span>
						<!--<div class="pull-right">-->
							<!--<span class="col-12">-->
								<!--&lt;!&ndash; <a href="{:U('Task/index')}">发布任务</a>&nbsp;&nbsp; &ndash;&gt;-->
								<!--<a href="{:U('editProduct','id='.$vo['id'])}">编辑</a>&nbsp;&nbsp;-->
								<!--<a onclick="delProduct({$vo.id});">删除</a>-->
							<!--</span>	-->
						<!--</div>-->
					</li>
				</foreach>
				<div class="pagination">
					{$page}
				</div>
			</empty>
		</ul>
	</div>
</block>
<block name="js">
	<script type="text/javascript">
		function delProduct(id)	{
			ui_confirm('确定删除吗', function() {
				sendAjax("{:U('delProduct')}",'id='+id, function(data) {
					if (data.status) {
						location.reload(true);
					} else {
						ui_error(data.info);
					}
				});	
			});
		}
	</script>
</block>